#include "EpilMethodCallExpressionCode.h"
#include "EpilOutputHelper.h"
#include "TCharSupport.h"


EpilMethodCallExpressionCode::EpilMethodCallExpressionCode( const EpilLexLocation & location )
: EpilFunctionCallExpressionCodeBase( location )
{
}


EpilMethodCallExpressionCode::~EpilMethodCallExpressionCode()
{
}


tstring EpilMethodCallExpressionCode::ToEpilCode( int indent ) const
{
	tstringstream ret;
	ret << this->GetTableExpression()->ToEpilCode();
	ret << t(":");
	ret << m_methodName;
	if( this->GetArguments().empty() )
	{
		ret << t("()");
	}
	else
	{
		ret << t("( ");
		ret << EpilOutputHelper::GetListOutput( this->GetArguments(), t(", ") );
		ret << t(" )");
	}
	return ret.str();
}